<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>RT</title>
  <style media="screen">
    #map {
      width: 1336px;
      height: 760px;
    }
  </style>
</head>
<body>
<!--
http://data-visual.cn/datav/demo.html#Echarts3/maps/map-lines.html
https://github.com/ecomfe/echarts/tree/master/extension/bmap
https://github.com/ecomfe/vue-echarts
 -->

<div id="map"></div>


<script type="text/javascript" src="http://api.map.baidu.com/api?v=3.0&ak=XCysCips5YQngYwbVCNH8Gxp6ezO9Yw2"></script>
<script src="../../static/libs/echarts.min.js"></script>
<script src="../../static/libs/bmap.min.js"></script>
<script>

// var map = new BMap.Map("map");
// var point = new BMap.Point(116.404, 39.915);
// map.centerAndZoom(point, 15);

var option = {
    // 加载 bmap 组件
    bmap: {
        // 百度地图中心经纬度
        center: [120.13066322374, 30.240018034923],
        // 百度地图缩放
        zoom: 14,
        // 是否开启拖拽缩放，可以只设置 'scale' 或者 'move'
        roam: true,
        // 百度地图的自定义样式，见 http://developer.baidu.com/map/jsdevelop-11.htm
        mapStyle: {}
    },
    series: [{
        type: 'scatter',
        // 使用百度地图坐标系
        coordinateSystem: 'bmap',
        // 数据格式跟在 geo 坐标系上一样，每一项都是 [经度，纬度，数值大小，其它维度...]
        data: [ [120.13066322374, 30.240018034923, 1] ]
    }]
};

var chart = echarts.init(document.getElementById('map'));
chart.setOption(option);

var bmap = chart.getModel().getComponent('bmap').getBMap();
bmap.addControl(new BMap.MapTypeControl());

</script>
</body>
</html>
